package com.eig.order.controller;

import com.eig.common.entity.order.FormData;
import com.eig.common.entity.order.TOrder;
import com.eig.common.vo.Result;
import com.eig.common.vo.order.OrderLog;
import com.eig.order.service.TOrderService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * 订单(TOrder)表控制层
 *
 * @author makejava
 * @since 2022-12-07 18:43:24
 */
@RestController
@RequestMapping("/order/order")
public class TOrderController {
    /**
     * 服务对象
     */
    @Resource
    private TOrderService tOrderService;

    @PostMapping("/getAllOrder/{currentPage}/{pageSize}")
    public Result<Map> getAllOrder(@PathVariable(required = true) Integer currentPage,
                                   @PathVariable(required = true) Integer pageSize,
                                   @RequestBody FormData formData){
        return new Result<Map>(2000,"查询成功",tOrderService.getAllOrder(currentPage, pageSize,formData));
    }


    @PostMapping("/queryOrderAndPayLog/{id}")
    public Result<OrderLog> queryOrderAndPayLog( @PathVariable(required = true)String id){
        return new Result<OrderLog>(2000,"查询成功",tOrderService.getByidOrderLog(id));
    }

}

